<template>
  <div class="app-container">
    <el-card>
      <el-table v-loading="loading" :data="orderTeamList" border>
        <el-table-column label="订单ID" align="center" prop="orderTeamId" />
        <el-table-column label="订单编号" align="center" prop="orderTeamSn" :show-overflow-tooltip="true" />
        <el-table-column label="下单人姓名" align="center" prop="customerName" :show-overflow-tooltip="true" />
        <el-table-column label="下单人手机号" align="center" prop="customerPhone" :show-overflow-tooltip="true" />
        <el-table-column label="施工队订单姓名" align="center" prop="teamInfoName" :show-overflow-tooltip="true" />
        <el-table-column label="施工队订单手机号" align="center" prop="teamInfoPhone" :show-overflow-tooltip="true" />
        <el-table-column label="店铺名称" align="center" prop="info.supplierInfo.shopsName" :show-overflow-tooltip="true" />
        <el-table-column label="地址" align="center" prop="address" :show-overflow-tooltip="true" />
        <el-table-column label="支付方式" align="center">
        <template slot-scope="scope">
          <span v-if="scope.row.paymentMethod == 1">现金</span>
          <span v-else-if="scope.row.paymentMethod == 2">余额</span>
          <span v-else-if="scope.row.paymentMethod == 3">网银</span>
          <span v-else-if="scope.row.paymentMethod == 4">支付宝</span>
          <span v-else-if="scope.row.paymentMethod == 5">微信</span>
        </template>
        </el-table-column>
        <el-table-column label="订单金额" align="center" prop="orderMoney" :show-overflow-tooltip="true" />
        <el-table-column label="优惠金额" align="center" prop="districtMoney" :show-overflow-tooltip="true" />
        <el-table-column label="支付金额" align="center" prop="paymentMoney" :show-overflow-tooltip="true" />
<!--        <el-table-column label="下单时间" align="center" prop="createTime" width="160">-->
<!--          <template slot-scope="scope">-->
<!--            <span>{{ parseTime(scope.row.createTime) }}</span>-->
<!--          </template>-->
<!--        </el-table-column>-->
<!--        <el-table-column label="支付时间" align="center" prop="payTime" width="160">-->
<!--          <template slot-scope="scope">-->
<!--            <span>{{ parseTime(scope.row.payTime) }}</span>-->
<!--          </template>-->
<!--        </el-table-column>-->
        <el-table-column label="订单状态" align="center" :show-overflow-tooltip="true">
          <template slot-scope="scope">
            <el-tag v-if="scope.row.orderStatus == 0">待付款</el-tag>
            <el-tag v-else-if="scope.row.orderStatus == 2">待收货</el-tag>
            <el-tag v-else-if="scope.row.orderStatus == 3" type="success">已完成</el-tag>
            <el-tag v-else-if="scope.row.orderStatus == 4" type="success">已完结</el-tag>
            <el-tag v-else-if="scope.row.orderStatus == 5" type="info">交易取消</el-tag>
          </template>
        </el-table-column>
<!--        <el-table-column label="订单积分" align="center" prop="orderPoint" :show-overflow-tooltip="true" />-->
<!--        <el-table-column label="订单描述" align="center" prop="orderDescribe" :show-overflow-tooltip="true" />-->
<!--        <el-table-column label="发票抬头" align="center" prop="invoiceTime" :show-overflow-tooltip="true" />-->
<!--        <el-table-column label="施工开始时间" align="center" prop="teamInfoStarTime" width="160">-->
<!--          <template slot-scope="scope">-->
<!--            <span>{{ parseTime(scope.row.teamInfoStarTime) }}</span>-->
<!--          </template>-->
<!--        </el-table-column>-->
<!--        <el-table-column label="施工开始时间" align="center" prop="teamInfoEndTime" width="160">-->
<!--          <template slot-scope="scope">-->
<!--            <span>{{ parseTime(scope.row.teamInfoEndTime) }}</span>-->
<!--          </template>-->
<!--        </el-table-column>-->
      </el-table>
      <pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
    </el-card>
  </div>
</template>

<script>

  import {
    listSuperOrderTeam,
  } from "@/api/super/superTeamSupplier";

  export default {
    name: "Info",
    data() {
      return {
        // 遮罩层
        loading: true,
        // 选中数组
        ids: [],
        // 非单个禁用
        single: true,
        // 非多个禁用
        multiple: true,
        // 显示搜索条件
        showSearch: true,
        // 总条数
        total: 0,
        // 订单表格数据
        orderTeamList: null,
        // 弹出层标题
        title: "",
        // 是否显示弹出层
        open: false,
        // 日期范围
        dateRange: [],
        // 查询参数
        queryParams: {
          pageNum: 1,
          pageSize: 10,
          teamInfoId: undefined,
        },
        defaultProps: {
          children: "children",
          label: "label",
        },
      };
    },
    created() {
      let teamInfoId = parseInt(this.$route.query.constructionId);
      this.getList(teamInfoId);
    },
    methods: {
      /* 查询类别列表 **/
      getList(teamInfoId){
        this.loading = true;
        this.queryParams.teamInfoId = teamInfoId;
        listSuperOrderTeam(this.queryParams).then(response => {
          this.orderTeamList = response.rows;
          this.total = response.total;
          this.loading = false;
        });
      },
    }
  }
</script>

<style scoped>

</style>
